* (bug 5161) Don't try to load template list for nonexistent pages
authorBrion Vibber <brion@users.mediawiki.org>
Tue, 7 Mar 2006 04:23:09 +0000 (04:23 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Tue, 7 Mar 2006 04:23:09 +0000 (04:23 +0000)
RELEASE-NOTES
includes/Article.php

index d25dcac..7f6f843 100644 (file)
@@ -679,6 +679,7 @@ fully support the editing toolbar, but was found to be too confusing.
 * (bug 5152) Proper HTML escaping on subpage breadcrumbs
 * (bug 4855) Section edit links now have the section name in the title attribute.
 * (bug 2115) Support shift-selecting multiple checkboxes with JavaScript.
+* (bug 5161) Don't try to load template list for nonexistent pages
 
 
 === Caveats ===
index 9fd25e3..35aacef 100644 (file)
@@ -2625,6 +2625,9 @@ class Article {
        function getUsedTemplates() {
                $result = array();
                $id = $this->mTitle->getArticleID();
+               if( $id == 0 ) {
+                       return array();
+               }
 
                $dbr =& wfGetDB( DB_SLAVE );
                $res = $dbr->select( array( 'templatelinks' ),